package com.zcx.qshop.activity;

import android.os.Bundle;
import android.webkit.WebView;

import com.zcx.helper.bound.BoundView;
import com.zcx.qshop.R;
import com.zcx.qshop.entity.Good;
import com.zcx.qshop.view.TitleView;

/**
 * Created by Administrator on 2015/9/14 0014.
 */
public class WebActivity extends QSActivity {

    @BoundView(R.id.title_view) private TitleView titleView;

    @BoundView(R.id.web_web_view) private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_web);

        Good good = (Good)getIntent().getSerializableExtra("Good");

        titleView.showStyle(TitleView.Style.FULL);

        titleView.showType(TitleView.Type.BACK_TWO, TitleView.Type.NAME_ONE);

        titleView.setTitleName(good.title);

        titleView.setOnTitleItemClickListener(new TitleView.OnTitleItemClickListener() {

            @Override
            public void onBackClick() {

                finish();

            }

        });

        try{

            webView.loadUrl(good.pid);

        }catch (Exception e){}

    }

}
